<?php /*a:2:{s:60:"/www/wwwroot/llz/application/admin/view/blacklist/index.html";i:1601119706;s:58:"/www/wwwroot/llz/application/admin/view/public/father.html";i:1708691164;}*/ ?>
<!DOCTYPE html>
<html lang="zh">
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
    <link rel="stylesheet" href="/static/layuiadmin/layui/css/layui.css" media="all">
    <link rel="stylesheet" href="/static/layuiadmin/style/admin.css" media="all">
    <style>*{font-weight: 300;}</style>
    
</head>
<body>

<div style="margin: 15px;">
    
<div class="layui-card">
    <div class="layui-card-header">黑名单管理</div>
    <div class="layui-card-body">

        <div class="layui-btn-container">
            <button type="button" class="layui-btn layui-btn-danger deleteall"><i class="layui-icon layui-icon-delete"></i>清空黑名单</button>
            <button class="layui-btn layui-btn-primary" onclick="javascript:location.reload();"><i class="layui-icon layui-icon-ok-circle"></i> 刷新页面</button>
        </div>

        <table class="layui-hide" id="dataTable" lay-filter="dataTable"></table>

        <script type="text/html" id="barDemo">
            <a class="layui-btn layui-btn-primary layui-btn-xs" lay-event="del" data-table="blacklists"><i class="layui-icon layui-icon-delete"></i>移除</a>
        </script>

    </div>
</div>

</div>

<script src="/static/js/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="/static/layuiadmin/layui/layui.js" type="text/javascript"></script>
<script src="/static/js/public.js" type="text/javascript"></script>

<script type="text/javascript">
    layui.use(['table', 'layer', 'form'], function() {
        var $ = layui.jquery, table = layui.table, layer = layui.layer, form = layui.form;

        table.render({
            elem: '#dataTable',
            url: "<?php echo url(); ?>",
            title: '数据表',
            totalRow: true,
            limit: 20,
            cols: [
                [
                    {field: 'left',	title:'操作',	width:90,	align:'center',	toolbar:'#barDemo',	totalRowText:'操作'},
                    {field: 'url',	title:'来源',	minWidth:200,	totalRowText:'来源'},
                    {field: 'ip',	title:'IP地址',	width:150,	align:'center',	sort:true,	totalRowText:'IP地址'},
            {field: 'create_time',	title:'时间',	width:180,	align:'center',	totalRowText:'时间'},
                ]
            ],
            page: true
        });

    });


    $('.deleteall').click(function () {
        layer.confirm('真的要清空吗？', {
            // skin: 'layui-layer-lan',
            // closeBtn: 0,
            // anim: 6
        }, function() {
            $.get("<?php echo url('del_all_data'); ?>", {}, function (res) {
                if ( res.code === 1 ){
                    success(res.msg, function () {
                        window.location.reload();
                    });
                } else {
                    error(res.msg);
                }
            }, 'json');
        });

    });

</script>

</body>
</html>